Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cluster singleton #628

Merged
merged 24 commits into from
Feb 21, 2025
Merged

feat: add cluster singleton #628

merged 24 commits into from
Feb 21, 2025

Conversation

Tochemey
Copy link
Owner

@Tochemey Tochemey commented Feb 20, 2025

This will help create cluster singleton actors that will have the following characteristics:

  • Only a single instance of that type of actor will be created in the whole cluster
  • A singleton actor will only be created on the oldest node of the cluster.
  • When the oldest node of the cluster shutdowns, the singleton actor will be recreated on the newest oldest node of the cluster.
  • A singleton actor is created with the default actor system supervisor and directive. One cannot set custom mailbox to a singleton actor.
  • They can only be accessed via their name(alias)

TODOs

  • Implementation
  • Cleanup(a.k.a refactor)
  • Code coverage

#627

@Tochemey Tochemey added feature New feature or request enhancement labels Feb 20, 2025
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 81.71745% with 66 lines in your changes missing coverage. Please review.

Project coverage is 83.41%. Comparing base (75891ff) to head (f22aeab).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/cluster/engine.go 69.84% 14 Missing and 5 partials ⚠️
actor/actor_system.go 83.33% 14 Missing and 4 partials ⚠️
actor/cluster_singleton.go 81.33% 10 Missing and 4 partials ⚠️
internal/collection/syncmap/map.go 0.00% 12 Missing ⚠️
actor/rebalancer.go 92.68% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #628      +/-   ##
==========================================
- Coverage   83.50%   83.41%   -0.09%     
==========================================
  Files         105      107       +2     
  Lines        9156     9396     +240     
==========================================
+ Hits         7646     7838     +192     
- Misses       1161     1200      +39     
- Partials      349      358       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sdil
Copy link
Contributor

sdil commented Feb 21, 2025

This sounds like the offset engine in ego 😄

@Tochemey Tochemey marked this pull request as ready for review February 21, 2025 13:20
@Tochemey Tochemey merged commit db15608 into main Feb 21, 2025
6 checks passed
@Tochemey Tochemey deleted the issue-627 branch February 21, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants